package com.erp.myAdapter

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.BaseAdapter
import com.erp.R
import kotlinx.android.synthetic.main.lv_downloag_item.view.*

/**
 * Created by Administrator on 2019/9/27/027.
 * 作者：刘洋
 */
class DownLoagAdapter(private var mlist: List<String>, private val mcontext: Context) : BaseAdapter() {
    private val minflater: LayoutInflater = LayoutInflater.from(mcontext)

    override fun getCount(): Int = mlist.size

    override fun getItem(position: Int): Any = mlist[position]

    override fun getItemId(position: Int): Long = position.toLong()

    override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
        var v :View
        v = minflater.inflate(R.layout.lv_downloag_item, null)
        val tv = v.TvFile
        tv.text = mlist[position]
        return v
    }
}